import util.TreeNode;

/**
 * Created by losor on 2016/9/30.
 */
public class _100_Same_Tree {
    public boolean isSameTree(TreeNode p, TreeNode q) {
        if (p == null && q == null){
            return true;
        }
        else if(p == null || q == null){
            return false;
        }

        return isSameTree(p.left,q.left) && isSameTree(p.right,q.right) && q.val== p.val;
    }


}
